package com.fanhang.samples.jdbc;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;

import org.junit.Test;

public class SimpleOperation {
	
	private ConnectionProvider cp = ConnectionProvider.getInstance();

	
	@Test
	public void insert() {
		try {
			Statement stmt = cp.getConnection().createStatement();
			stmt.execute("select 1,2,3");
			ResultSet rs = stmt.getResultSet();
			while (rs.next()) {
				System.out.println(String.format("%s -- %s -- %s", rs.getString(1), rs.getString(2), rs.getString(3)));
				
			}
		} catch (SQLException e) {
			e.printStackTrace();
		} catch (Exception e) {
			e.printStackTrace();
		}

	}
	

}
